The Beans area
Here is where you build the user interface of your application.
User interfaces in Java are built in a
hierarchical way with Java Beans grouped inside containers and containers inside a Window
or Dialog. Each container controls the way its children are laid out and behave when resized.
Selecting Components
You may select a component in the hierarchy by clicking over it. To select more than one component, click and drag a rectangle over them or hold
down the Shift key to add or remove to the selection list.
Adding Components to your Design
Most designs begin by placing down a Frame (
) or
Dialog (
) component.; but it is perfectly legal to place
any type of component down to start with.
Only certain types of components may be placed down at a particular time. For example: you can place a Button
under a Panel,
but you cannot place a Button under a Button.
Panel is a container and can contain other components; whereas a Button is not.
Visaj assists you by only allowing you to add those components which can be made children of the parent component; all others are made insensitive.
Composite Components
With the Swing components comes a new concept: Composite components.
Composite components are components which are made up of many other components.
Examples of Composite components are: JFrame, JDialog, JWindow, JRootPane, JScrollPane, and JApplet.
By default when a Composite component is added to your hierarchy its constituent components are also shown. These components are laid out exactly as specified in the JFC API docs.
The properties of these constituent components may be changed as you wish, and components added if appropriate.
If you do not wish to see the constituents of a Composite component you may Collapse the component. In the View menu you have the option to collapse all
Composite components or just the currently selected one.
You may also collapse a Composite component bybringing up the Popup menu for that component.
Multiple Hierarchies
New to Visaj 2.0 is the ability to have multiple hierarchies in the same Method. In previous versions of Visaj, you were only allowed to have one hierarchy per Method.
Now, you are able to add as many invisible beans or hierarchies to a method as you like.
To add an invisible bean or to start a new hierarchy in the current method, you should make sure that none of the components in the Beans area are selected, and then select
the Bean from the Palette.